Ext.define('appmod.view.knowledge.content.BigView', {
    extend: 'Ext.panel.Panel',
    alias: [
		'widget.knowledge.content.bigview',
		'widget.knowledge-content-bigview'
	],
	bodyCls:['x-dataview-panel-body'],
	region : 'center',
    layout : {
		type:'border'
	},
	requires: [
	    'Ext.ux.DataView.DragSelector',
	    'Ext.ux.DataView.LabelEditor'	
	],	
	border : false,
	margins:"5 5 5 5",
    initComponent: function() {
		//--- this variable is set for winCat
		var me = this;

        Ext.applyIf(me, {
            items:[
				Ext.create('Ext.view.View', {
					store:me.store,
					tpl:[
		                '<tpl for=".">',
		                    '<div class="thumb-wrap" id="{id}">',
		                    '<div class="thumb"><img src="{url}" title="{name}"></div>',
		                    '<div class="x-editable">{name}</div></div>',
		                '</tpl>',
		                '<div class="x-clear"></div>'					
					],
		            multiSelect: true,
		            height: 310,
		            trackOver: true,
		            overItemCls: 'x-item-over',
		            itemSelector: 'div.thumb-wrap',
		            emptyText: '没有相关文件',
		            plugins: [
		                Ext.create('Ext.ux.DataView.DragSelector', {}),
		                Ext.create('Ext.ux.DataView.LabelEditor', {dataIndex: 'fileName'})
		            ]										
				})
			],
			dockedItems: [{
			    xtype: 'toolbar',
			    dock: 'top',
			    items: [
			
                   {
                        xtype: 'button',
                        text: '上传附件',
						action :'uploadMultiFiles'
                    },
					{
						xtype:'button',
						text:'删除',
						action:'deleteBigView'
					},
					'-',
					{
						xtype:'combobox',
						name:'fileFormat',
						labelWidth:60,
						allowBlank:false,
						editable:false,
					    displayField: 'name',
					    valueField: 'id',
						value:'all',
				        typeAhead: true,
				        mode: 'local',
				        triggerAction: 'all',
				        emptyText:'显示分类',
				        selectOnFocus:true,
				        width:180						
					}
			    ]
			}]							
        });
	    me.callParent(arguments);
    },
	
	bindStore:function(store) {
		var me = this;
		
		var dataview = me.down('dataview');
		dataview.bindStore(store);
		
	},
	
	getView:function() {
		var me = this;
		var view = me.down('dataview');
		return view;
	}
});